package com.usian.mapper;

import com.usian.appointments.Appointments;
import com.usian.image.Images;
import com.usian.user.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface AppointmentsMapper {
    @Select("select * from t_appointments where 1=1")
    List<Appointments> findAll(Appointments appointments);
    @Select(" select * from tb_user where id=#{id}")
    User selectUserById(Integer userId);

    @Insert("insert into t_appointments(id,activeName,plan,img,destination,meetingPlace,meetingTime,activeType,cost,num,userId,people)\n" +
            "        values(#{id},#{activeName},#{plan},#{img},#{destination},#{meetingPlace},#{meetingTime},#{activeType},#{cost},#{num},#{userId},#{people})")
    int add(Appointments appointments);

    @Select("select * from t_appointments where userId=#{userId}")
    List<Appointments> findById(Integer userId);

    @Select("select * from tb_user where id=#{id}")
    User selectUserByIdTwo(Integer id);

    @Select("select * from t_appointments where id=#{id}")
    Appointments echo(Integer id);

}
